/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Clases;

import com.mysql.jdbc.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Daniel
 */
public class ConectarBD {
   static String login = "root";
   static String password = "santiago";
   static String url = "jdbc:mysql://localhost/club";
   private static final String CLASE_DRIVER_MYSQL = "com.mysql.jdbc.Driver";

     public static Connection getConnection(){
       Connection connect = null;
       try{         
         Class.forName(CLASE_DRIVER_MYSQL);
         connect = (Connection) DriverManager.getConnection(url,login,password);         
      }catch(SQLException e){
         System.out.println(e.getMessage().toString());
      }catch(ClassNotFoundException e){
         System.out.println(e.getMessage().toString());
      }
       return connect;
   }
}    
    

